package com.pool.store;

import java.util.List;

import com.pool.auth.Auth;
import com.pool.common.Lists;
import com.pool.common.Shoot;
import com.pool.net.SpreadsheetsConnector;
import com.pool.store.gdata.ShootGDataFactory;

/**
 * Provides an interface with Google Spreadsheets API for storing/retrieving {@link Shoot}s.
 * 
 * @author claveld@gmail.com (David Clavel)
 */
public class SpreadsheetsShootStore extends AbstractSpreadsheetsStore<Shoot> implements Store<Shoot> {

  private static final String SHOOTS_2010_TABLE_URL =
    "http://spreadsheets.google.com/feeds/tg91qh8FwCs_tWTylybERFg/records/2";
  
  public SpreadsheetsShootStore() {
    this(Auth.get(), SpreadsheetsConnector.get());
  }
  
  public SpreadsheetsShootStore(Auth auth, SpreadsheetsConnector connector) {
    super(auth, connector);
  }

  public List<Shoot> getAll() {
    List<Shoot> shoots = Lists.newArrayList();
    sendRetrieveRequest(SHOOTS_2010_TABLE_URL, new ShootGDataFactory(), shoots);
    return shoots;
  }

  @Deprecated
  public boolean add(Shoot e) { return false; }
  @Deprecated
  public boolean delete(Shoot e) { return false; }
  @Deprecated
  public Shoot get(String id) { return null; }
  @Deprecated
  public int getCount() { return 0; }
  @Deprecated
  public boolean update(Shoot e) { return false; }
  @Deprecated
  public boolean deleteAll() { return false; }
}
